package com.sanbi.common.express.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @description: 菜鸟服务类型枚举
 * @author: wanpeng
 * @create: 2024-05-13 17:12
 * @Version 1.0
 **/
@AllArgsConstructor
@Getter
public enum CaiNiaoServiceCodeEnum {
    F("F", "订单履约"),
    S("S", "自发服务"),
    T("T", "转运服务"),
    R("R", "退件服务");

    private final String code;

    private final String desc;

    public static CaiNiaoServiceCodeEnum getByCode(String code) {
        for (CaiNiaoServiceCodeEnum e : CaiNiaoServiceCodeEnum.values()) {
            if (Objects.equals(e.getCode(), code)) {
                return e;
            }
        }
        return null;
    }
}
